<template>
	<view class="main" :style="'top:'+(-demo.height-demo.top-10)+'px'">
		<view :style="'padding-top:'+(demo.height+demo.top+10)+'px'">
			<head1 class="nav_top"
				:style="'height:' +  demo.height + 'px;' + 'padding-top:' + demo.top + 'px;padding-bottom:10px'"
				:nav="title">
			</head1>
		</view>
		<view class="hahah" :style="'padding-bottom:'+(demo.height+demo.top+10)+'px'">
			<view class="tenderFile" v-for="(item,index) in dataMain" :key="index"  @click="detail(item.id)">
				<view class="tit">
					{{item.xmmc}}
				</view>
				<view class="tenderFile_main">
					<view class="mainLeft">
						<view>
							<text>参标人员：</text>
							<text>{{item.ctry}}</text>
						</view>
						<view>
							<text>开标地点：</text>
							<text>{{item.kbdd}}</text>
						</view>
						<view style="display: flex;justify-content: space-between;">
							<view style="padding: 0;">
								<text>中标名次：</text>
								<text>{{item.hxrpx}}</text>
							</view>
						</view>
						<view>
							<text>公示期：</text>
							<text>{{item.gsq}}</text>
						</view>
						<view>
							<text>开标时间：</text>
							<text>{{item.kbsj}}</text>
						</view>
					</view>
					
				</view>
			</view>
		</view>
		<view class="meishuju" v-if="isLoading==true" :style="'padding-top:'+(demo.height+demo.top+10)+'px'" v-show="dataMain.length==0">
			<text>暂无数据!</text>
		</view>
	</view>
</template>

<script>
	import head1 from '../head/head.vue'
	export default {
		components: {
			head1
		},
		data() {
			return {
				title: '投标档案',
				isLoading:false,
				demo: {
					top: '',
					height: ''
				},
				dataList: {
					userId: '',
					sfzh: ''
				},
				dataMain: []
			}
		},
		computed: {
			userid() {
				return this.$store.state.userId
			},
			sfzh() {
				return this.$store.state.sfzh
			}
		},
		created() {
			const demo = uni.getMenuButtonBoundingClientRect()
			this.demo.top = demo.top
			this.demo.height = demo.height
			this.dataList.userId = this.userid
			this.dataList.sfzh = this.sfzh
			this.getPersonBid(this.dataList)
		},
		methods: {
			detail(ids){
				uni.navigateTo({
					url:'./tenderFileDetail?id='+ids
				})
			},
			getPersonBid(dataList) {
				let _this=this;
				uni.showLoading({
					title:'正在为您加载中....',
					success() {
						setTimeout(()=>{
							_this.$myResquest.getPersonBid(dataList).then(res => {
								if (res.data.code == 200) {
									_this.dataMain = JSON.parse(res.data.data)
									if(_this.dataMain.length==0){
										_this.isLoading=true
									}
									uni.hideLoading()
								}
							})
						},1000)
					}
				})
				
			},
			nowReal() {
				uni.navigateTo({
					url: '../realName/nowReal'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		position: fixed;
		top: 0;
		z-index: 999;
		height: 100%;
		width: 100%;

		.nav_top {
			position: relative;
			background: #ffffff;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
			min-width: 750rpx;
		}

		.noReal_main {
			position: absolute;
			width: 100%;
			height: 100%;

			view {
				position: relative;
				height: 100%;

				image {
					width: 100%;
					height: 100%;
					max-height: 1208rpx;
				}

				.btn {
					position: absolute;
					width: 600rpx;
					max-width: 600rpx;
					height: 88rpx;
					background: #4bb1af;
					border-radius: 44rpx;
					font-size: 34rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: left;
					color: #ffffff;
					z-index: 9999;
					left: 76rpx;
					line-height: 88rpx;
					text-align: center;
					top: 1020rpx;
				}
			}
		}

		.hahah {
			height: 100%;
			overflow: auto;
			background-color: #f9f9f9;
		}

		.tenderFile {
			    width: 658rpx;
			    background: #ffffff;
			    border-radius: 20rpx;
			    margin: 20rpx auto;
			    box-sizing: content-box;


			.tit {
				padding:16rpx 0;
				background: #5cd1ce;
				font-size: 34rpx;
				font-family: PingFang SC, PingFang SC-Medium;
				font-weight: 500;
				text-align: center;
				color: #ffffff;
				line-height: 60rpx;
				border-top-left-radius: 10rpx;
				border-top-right-radius: 10rpx;
			}

			.tenderFile_main {
				display: flex;
				background: #f7f7f7;
				.mainLeft {
					font-size: 25rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: left;
					color: #332c2b;
					line-height: 56rpx;
					padding-top: 10rpx;
					padding-left: 16rpx;
					box-sizing: border-box;
					view{
						    margin-top: 20rpx;
						    background: #ffffff;
						    padding: 0 30rpx;
						    box-sizing: border-box;
					}

				}

				.mainRight {
					width: 156rpx;
					height: 56rpx;
					background: #4bb1af;
					border-radius: 28rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					    margin-right: 10rpx;
					text {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						text-align: left;
						color: #ffffff;
					}
				}
			}
		}
	}

	.meishuju {
		position: absolute;
		top: 150rpx;
		width: 750rpx;
		text-align: center;
		height: 250rpx;
		line-height: 250rpx;
	}
</style>
